import {call } from 'redux-saga/effects'
import axios from '@/utils/request.js'

import { message } from 'antd';

// 拼团商品数据模糊搜索
function* getpinAdd(payload) {
    console.log(payload, 'payload');

    const res = yield call(axios, {
        url: "/api/getpinAdd",
        method: "post",
        data: {
            img: payload.payload.uploadUrl,
            imglun: payload.payload.imglun,
            title: payload.payload.valueName,
            work: payload.payload.valueIntroduction,
            danw: payload.payload.valueUnit,
            time: payload.payload.valueDate[1],
            mouse: payload.payload.valueResults,
            ren: payload.payload.valuePeople,
            nummer: payload.payload.valueLimit,
            status: payload.payload.valueDan
        }
    })
    // console.log(res, 'res');

    if (res.code === 1) {
        message.success('添加成功');
    }else{
        message.error('添加失败');
    }
}


export {
    getpinAdd
}